package com.ruoyi.base.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BaseDocumentMapper;
import com.ruoyi.base.domain.BaseDocument;
import com.ruoyi.base.service.IBaseDocumentService;

/**
 * 型号Service业务层处理
 * 
 * @author yepanpan
 * @date 2024-12-20
 */
@Service
public class BaseDocumentServiceImpl implements IBaseDocumentService 
{
    @Autowired
    private BaseDocumentMapper baseDocumentMapper;

    /**
     * 查询型号
     * 
     * @param id 型号主键
     * @return 型号
     */
    @Override
    public BaseDocument selectBaseDocumentById(Long id)
    {
        return baseDocumentMapper.selectBaseDocumentById(id);
    }

    /**
     * 查询型号列表
     * 
     * @param baseDocument 型号
     * @return 型号
     */
    @Override
    public List<BaseDocument> selectBaseDocumentList(BaseDocument baseDocument)
    {
        return baseDocumentMapper.selectBaseDocumentList(baseDocument);
    }

    /**
     * 新增型号
     * 
     * @param baseDocument 型号
     * @return 结果
     */
    @Override
    public int insertBaseDocument(BaseDocument baseDocument)
    {
        baseDocument.setCreateTime(DateUtils.getNowDate());
        return baseDocumentMapper.insertBaseDocument(baseDocument);
    }

    /**
     * 修改型号
     * 
     * @param baseDocument 型号
     * @return 结果
     */
    @Override
    public int updateBaseDocument(BaseDocument baseDocument)
    {
        baseDocument.setUpdateTime(DateUtils.getNowDate());
        return baseDocumentMapper.updateBaseDocument(baseDocument);
    }

    /**
     * 批量删除型号
     * 
     * @param ids 需要删除的型号主键
     * @return 结果
     */
    @Override
    public int deleteBaseDocumentByIds(Long[] ids)
    {
        return baseDocumentMapper.deleteBaseDocumentByIds(ids);
    }

    /**
     * 删除型号信息
     * 
     * @param id 型号主键
     * @return 结果
     */
    @Override
    public int deleteBaseDocumentById(Long id)
    {
        return baseDocumentMapper.deleteBaseDocumentById(id);
    }
}
